//Fri Oct 21 22:12:24 PDT 2011
import java.util.HashSet;

public class BorelSets {

	public HashSet<String> set;

	public int howMany(int size, String[] subsets) {
		for (int i = 0; i < subsets.length; i++)
			set.add(solve(size, subsets[i]));
		return (int) Math.pow(2, set.size());
	}

	String solve(int size, String sub) {
		String str = new String(new char[size]).replace('\0', '1');
		String[] nums = sub.split(" ");
		for (int i = 0; i < nums.length; i++) {
			int tmp = Integer.parseInt(nums[i]);
			str = str.substring(0, tmp - 1) + "0" + str.substring(tmp);
		}
		return str;
	}
}

